package april.example.socket;

import java.io.IOException;
import java.net.Socket;

import org.omg.CORBA.portable.UnknownException;

public class LowPortScanner {
	public static void main(String[] args) {
		String host = "172.16.101.22";

		if (args.length > 0) {
			host = args[0];
		}
		for (int i = 1; i < 1024; i++) {
			try {
				Socket s = new Socket(host, i);
				System.out.println("there is  a server on port " + i + " of "
						+ host);
			} catch (UnknownException e) {
				e.printStackTrace();
				break;
			} catch (IOException e) {
			}
		}

	}
}
